home *** CD-ROM | disk | FTP | other *** search
- Path: gidora.kralizec.net.au!root
- From: Ross McKay <rosko@zeta.org.au>
- Newsgroups: comp.lang.c++
- Subject: Re: Hungarian notation
- Date: Mon, 01 Jan 1996 14:45:59 -0800
- Organization: Soft Technologies
- Message-ID: <30E86427.3623@zeta.org.au>
- References: <cmanDK7x13.5KM@netcom.com> <verec-2712952049000001@ppp30.micronet.fr> <30E39BC0.3BAE@zeta.org.au> <verec-2912950003390001@ppp05.micronet.fr> <30E55183.52FF@zeta.org.au> <4c44dh$771@mujibur.inmind.com> <4c477m$ou4@macaw.cyberport.com>
- NNTP-Posting-Host: dialup71.syd1.zeta.org.au
- Mime-Version: 1.0
- Content-Type: text/plain; charset=us-ascii
- Content-Transfer-Encoding: 7bit
- X-Mailer: Mozilla 2.0b3 (Win16; I)
-
- Warren Young wrote:
- >
- > mfinney@inmind.com wrote:
- >
- > >In <30E55183.52FF@zeta.org.au>, Ross McKay <rosko@zeta.org.au> writes:
- > >We also treat #defines the same way as any other constant or function
- > >for the same reason. There have been many cases where something
- > >like...
- >
- > > #define insufficientStorage "Insufficient storage"
- >
- > >became something like...
- >
- > > w_char const insufficientStorage[] = L"Insufficient storage";
- >
- > >which is only a change in the type information and not in the
- > >semantics of the name.
- >
- > Sure the semantics change. Try passing the latter to printf() and see
- > how broken the program gets. Or strlen(), or strtou()... Granted,
- > you're likely to be changing the string manipulation functions at the
- > same time, but this is one place where HN becomes useful: helping you
- > find the places where you missed a function call that needs changing.
- >
-
- This is "implementation specific"... effecting the above change going
- from ISO Zinc to Unicode Zinc (8-bit ZIL_ICHARs become Unicode ZIL_ICHARs)
- calls (from within a Zinc-derived class) to sprintf() et al would _not_
- be broken.
-
- > >The use of upper case names to distinguish #define names is one
- > >of the worst pseudo-standards that have been fostered upon the
- > >programming community. Right up there with Hungarian notation.
- >
- > It's very useful with macros, because it tells the reader, "Hey! The
- > arguments to this macro aren't type-safe and there may be
- > side-effects!" With C++, though, I have a solution that both of us
- > might find acceptable: dump #defines for consts and inline functions.
- >
-
- Good point... anyone else have an opinion on this, because I rather favour
- the "treat 'em all the same" approach, however this is a clear situation
- where ALL_CAPS adds value.
-
- > = Warren --
-
- --
- // --------------------------------------------------------------------- //
- // Ross McKay | email: rosko@zeta.org.au | The opinions expressed //
- // Soft Technologies | snail: GPO Box 562, | are my own, not those //
- // Sydney, Australia | Sydney 2001, Aus. | of my employers. //
- // --------------------------------------------------------------------- //
- // "Circumcision is no skin off my nose" (grafitti seen in Ultimo) //
- // --------------------------------------------------------------------- //
-